home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 February: Tool Chest / Dev.CD Feb 95 / Dev.CD Feb 95.toast / Tool Chest / Interfaces / Universal Interfaces 2.0a3 / Universal AIncludes / CMApplication.a < prev    next >
Encoding:
Text File  |  1994-11-11  |  9.2 KB  |  490 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        CMApplication.a
  3. ;
  4. ;    Copyright:    © 1984-1994 by Apple Computer, Inc.
  5. ;                All rights reserved.
  6. ;
  7. ;    Version:    Universal Interfaces 2.0a3  ETO #16, MPW prerelease.  Friday, November 11, 1994. 
  8. ;
  9. ;    Bugs?:        If you find a problem with this file, send the file and version
  10. ;                information (from above) and the problem description to:
  11. ;
  12. ;                    Internet:    apple.bugs@applelink.apple.com
  13. ;                    AppleLink:    APPLE.BUGS
  14. ;
  15. ;
  16.  
  17.     IF &TYPE('__CMAPPLICATION__') = 'UNDEFINED' THEN
  18. __CMAPPLICATION__ SET 1
  19.  
  20.  
  21.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  22.     include 'Types.a'
  23.     ENDIF
  24. ;        include 'ConditionalMacros.a'                                ;
  25.  
  26.     IF &TYPE('__QUICKDRAW__') = 'UNDEFINED' THEN
  27.     include 'Quickdraw.a'
  28.     ENDIF
  29. ;        include 'MixedMode.a'                                        ;
  30. ;        include 'QuickdrawText.a'                                    ;
  31.  
  32.     IF &TYPE('__WINDOWS__') = 'UNDEFINED' THEN
  33.     include 'Windows.a'
  34.     ENDIF
  35. ;        include 'Memory.a'                                            ;
  36. ;        include 'Events.a'                                            ;
  37. ;            include 'OSUtils.a'                                    ;
  38. ;        include 'Controls.a'                                        ;
  39. ;            include 'Menus.a'                                        ;
  40.  
  41.     IF &TYPE('__PRINTING__') = 'UNDEFINED' THEN
  42.     include 'Printing.a'
  43.     ENDIF
  44. ;        include 'Errors.a'                                            ;
  45. ;        include 'Dialogs.a'                                        ;
  46. ;            include 'TextEdit.a'                                    ;
  47.  
  48. CMTrap                            EQU        $ABEE
  49.  
  50. ; PicComments 
  51. CMBeginProfile                    EQU        220
  52. CMEndProfile                    EQU        221
  53. CMEnableMatching                EQU        222
  54. CMDisableMatching                EQU        223
  55.  
  56. ; Defines for fieldMask in profile search record 
  57. kMatchCMMType                    EQU        $00000001
  58. kMatchApplProfileVersion        EQU        $00000002
  59. kMatchDataType                    EQU        $00000004
  60. kMatchDeviceType                EQU        $00000008
  61. kMatchDeviceManufacturer        EQU        $00000010
  62. kMatchDeviceModel                EQU        $00000020
  63. kMatchDeviceAttributes            EQU        $00000040
  64. kMatchFlags                        EQU        $00000080
  65. kMatchOptions                    EQU        $00000100
  66. kMatchWhite                        EQU        $00000200
  67. kMatchBlack                        EQU        $00000400
  68.  
  69. ; Profile Header version 
  70. kCMApplProfileVersion            EQU        $0100
  71.  
  72. ; Data types 
  73. rgbData                            EQU        'RGB '
  74. cmykData                        EQU        'CMYK'
  75. grayData                        EQU        'GRAY'
  76. xyzData                            EQU        'XYZ '
  77.  
  78. ; Device types 
  79. monitorDevice                    EQU        'mntr'
  80. scannerDevice                    EQU        'scnr'
  81. printerDevice                    EQU        'prtr'
  82. qdSystemDevice                    EQU        'sys '
  83. qdGDevice                        EQU        'gdev'
  84.  
  85. ; Profile flags 
  86. CMNativeMatchingPreferred        EQU        $00000001            ; Default to native not preferred 
  87. CMTurnOffCache                    EQU        $00000002            ; Default to turn on CMM cache 
  88.  
  89. ; Profile options 
  90. CMPerceptualMatch                EQU        $0000                ; Default. For photographic images 
  91. CMColorimetricMatch                EQU        $0001                ; Exact matching when possible 
  92. CMSaturationMatch                EQU        $0002                ; For solid colors 
  93.  
  94. ; ColorSync result codes 
  95. CMNoError                        EQU        0
  96. CMProfileError                    EQU        -170
  97. CMMethodError                    EQU        -171
  98. CMMemFullError                    EQU        -172
  99. CMUnimplementedError            EQU        -173
  100. CMParamError                    EQU        -174
  101. CMMethodNotFound                EQU        -175                ; CMM not present 
  102. CMProfileNotFound                EQU        -176                ; Responder error 
  103. CMProfilesIdentical                EQU        -177                ; Profiles the same 
  104. CMCantConcatenateError            EQU        -178                ; Profile can't be concatenated 
  105. CMCantXYZ                        EQU        -179                ; CMM cant handle XYZ space 
  106. CMCantDeleteProfile                EQU        -180                ; Responder error 
  107. CMUnsupportedDataType            EQU        -181                ; Responder error 
  108. CMNoCurrentProfile                EQU        -182                ; Responder error 
  109.  
  110. ;
  111. ;** Types
  112. ;
  113. XYZColor                 RECORD    0
  114. X                         ds.w    1                                    ; 1.15 bit unsigned fixed numbers 
  115. Y                         ds.w    1
  116. Z                         ds.w    1
  117. sizeof                     EQU    6
  118.                         ENDR
  119.  
  120. CMYKColor                 RECORD    0
  121. cyan                     ds.w    1
  122. magenta                     ds.w    1
  123. yellow                     ds.w    1
  124. black                     ds.w    1
  125. sizeof                     EQU    8
  126.                         ENDR
  127.  
  128. CMColor                 RECORD    0
  129. VariantLevel0Begin        EQU    *
  130. rgb                         ds        RGBColor
  131.                         ORG        VariantLevel0Begin
  132. xyz                         ds        XYZColor
  133.                         ORG        VariantLevel0Begin
  134. cmyk                     ds        CMYKColor
  135. sizeof                     EQU    8
  136.                         ENDR
  137.  
  138. CMHeader                 RECORD    0
  139. size                     ds.l    1                                    ; This is the total size of the Profile including custom data 
  140. CMMType                     ds.l    1                                    ; Corresponding CMM 
  141. applProfileVersion         ds.l    1                                    ; Version of CMProfile format 
  142. dataType                 ds.l    1                                    ; rgbData, etc. 
  143. deviceType                 ds.l    1                                    ; monitorDevice, etc. 
  144. deviceManufacturer         ds.l    1                                    ; Registered with DTS 
  145. deviceModel                 ds.l    1                                    ; Specific to Manufacturer 
  146. deviceAttributes         ds.l    2                                    ; Attributes like paper, ink, etc. 
  147. profileNameOffset         ds.l    1                                    ; Offset to profile name from top of data 
  148. customDataOffset         ds.l    1                                    ; Offset to custom data from top of data 
  149. flags                     ds.l    1
  150. options                     ds.l    1
  151. white                     ds        XYZColor
  152. black                     ds        XYZColor
  153. sizeof                     EQU    64
  154.                         ENDR
  155.  
  156. CMProfileSearchRecord     RECORD    0
  157. header                     ds        CMHeader
  158. fieldMask                 ds.l    1
  159. reserved                 ds.l    2
  160. sizeof                     EQU    76
  161.                         ENDR
  162.  
  163. CMProfileChromaticities RECORD    0
  164. red                         ds        XYZColor
  165. green                     ds        XYZColor
  166. blue                     ds        XYZColor
  167. cyan                     ds        XYZColor
  168. magenta                     ds        XYZColor
  169. yellow                     ds        XYZColor
  170. sizeof                     EQU    36
  171.                         ENDR
  172.  
  173. IString                 RECORD    0
  174. theScript                 ds.w    1
  175. theString                 ds.l    16
  176. sizeof                     EQU    66
  177.                         ENDR
  178.  
  179.  
  180. grayResponse                    EQU        0
  181. redResponse                        EQU        1
  182. greenResponse                    EQU        2
  183. blueResponse                    EQU        3
  184. cyanResponse                    EQU        4
  185. magentaResponse                    EQU        5
  186. yellowResponse                    EQU        6
  187. ucrResponse                        EQU        7
  188. bgResponse                        EQU        8
  189. onePlusLastResponse                EQU        9
  190.  
  191. CMProfileResponse         RECORD    0
  192. counts                     ds.w    1
  193. data                     ds.w    1                                    ; Variable size 
  194. sizeof                     EQU    4
  195.                         ENDR
  196.  
  197. CMProfile                 RECORD    0
  198. header                     ds        CMHeader
  199. profile                     ds        CMProfileChromaticities
  200. response                 ds        CMProfileResponse                    ; Variable size 
  201. profileName                 ds        IString                            ; Variable size 
  202. customData                 ds.b    1                                    ; Optional variable length custom CMM data 
  203. sizeof                     EQU    172
  204.                         ENDR
  205.  
  206. ;
  207. ;** Printing Stuff that will be moved later
  208. ;
  209.  
  210. enableColorMatchingOp            EQU        12
  211. registerProfileOp                EQU        13
  212.  
  213. ; PrGeneral parameter blocks 
  214. TEnableColorMatchingBlk RECORD    0
  215. iOpCode                     ds.w    1
  216. iError                     ds.w    1
  217. lReserved                 ds.l    1
  218. hPrint                     ds.l    1
  219. fEnableIt                 ds.b    1
  220. filler                     ds.b    1
  221. sizeof                     EQU    14
  222.                         ENDR
  223.  
  224. TRegisterProfileBlk     RECORD    0
  225. iOpCode                     ds.w    1
  226. iError                     ds.w    1
  227. lReserved                 ds.l    1
  228. hPrint                     ds.l    1
  229. fRegisterIt                 ds.b    1
  230. filler                     ds.b    1
  231. sizeof                     EQU    14
  232.                         ENDR
  233.  
  234. ;
  235. ;** High Level Calls
  236. ;
  237.     IF GENERATING68K THEN
  238.         Macro
  239.         _BeginMatching
  240.             dc.w     $203C
  241.             dc.w     $000C
  242.             dc.w     $0000
  243.             dc.w     $ABEE
  244.         EndM
  245.     ELSE
  246.         IMPORT    BeginMatching
  247.     ENDIF
  248.  
  249.     IF GENERATING68K THEN
  250.         Macro
  251.         _EndMatching
  252.             dc.w     $203C
  253.             dc.w     $0004
  254.             dc.w     $0001
  255.             dc.w     $ABEE
  256.         EndM
  257.     ELSE
  258.         IMPORT    EndMatching
  259.     ENDIF
  260.  
  261.     IF GENERATING68K THEN
  262.         Macro
  263.         _GetProfile
  264.             dc.w     $203C
  265.             dc.w     $0010
  266.             dc.w     $0000
  267.             dc.w     $ABEE
  268.         EndM
  269.     ELSE
  270.         IMPORT    GetProfile
  271.     ENDIF
  272.  
  273.     IF GENERATING68K THEN
  274.         Macro
  275.         _SetProfile
  276.             dc.w     $203C
  277.             dc.w     $000C
  278.             dc.w     $0000
  279.             dc.w     $ABEE
  280.         EndM
  281.     ELSE
  282.         IMPORT    SetProfile
  283.     ENDIF
  284.  
  285.     IF GENERATING68K THEN
  286.         Macro
  287.         _SetProfileDescription
  288.             dc.w     $203C
  289.             dc.w     $0010
  290.             dc.w     $0006
  291.             dc.w     $ABEE
  292.         EndM
  293.     ELSE
  294.         IMPORT    SetProfileDescription
  295.     ENDIF
  296.  
  297.     IF GENERATING68K THEN
  298.         Macro
  299.         _GetColorSyncFolderSpec
  300.             dc.w     $203C
  301.             dc.w     $000C
  302.             dc.w     $0007
  303.             dc.w     $ABEE
  304.         EndM
  305.     ELSE
  306.         IMPORT    GetColorSyncFolderSpec
  307.     ENDIF
  308.  
  309.     IF GENERATING68K THEN
  310.         Macro
  311.         _GetIndexedProfile
  312.             dc.w     $203C
  313.             dc.w     $0014
  314.             dc.w     $0008
  315.             dc.w     $ABEE
  316.         EndM
  317.     ELSE
  318.         IMPORT    GetIndexedProfile
  319.     ENDIF
  320.  
  321.     IF GENERATING68K THEN
  322.         Macro
  323.         _DeleteDeviceProfile
  324.             dc.w     $203C
  325.             dc.w     $000C
  326.             dc.w     $0009
  327.             dc.w     $ABEE
  328.         EndM
  329.     ELSE
  330.         IMPORT    DeleteDeviceProfile
  331.     ENDIF
  332.  
  333. ;
  334. ;** Data interchange routines
  335. ;
  336.     IF GENERATING68K THEN
  337.         Macro
  338.         _UseProfile
  339.             dc.w     $203C
  340.             dc.w     $0004
  341.             dc.w     $0000
  342.             dc.w     $ABEE
  343.         EndM
  344.     ELSE
  345.         IMPORT    UseProfile
  346.     ENDIF
  347.  
  348.     IF GENERATING68K THEN
  349.         Macro
  350.         _DrawMatchedPicture
  351.             dc.w     $203C
  352.             dc.w     $000C
  353.             dc.w     $0000
  354.             dc.w     $ABEE
  355.         EndM
  356.     ELSE
  357.         IMPORT    DrawMatchedPicture
  358.     ENDIF
  359.  
  360.     IF GENERATING68K THEN
  361.         Macro
  362.         _EnableMatching
  363.             dc.w     $203C
  364.             dc.w     $0002
  365.             dc.w     $0003
  366.             dc.w     $ABEE
  367.         EndM
  368.     ELSE
  369.         IMPORT    EnableMatching
  370.     ENDIF
  371.  
  372. ;
  373. ;** Profile concatenation
  374. ;
  375.     IF GENERATING68K THEN
  376.         Macro
  377.         _ConcatenateProfiles
  378.             dc.w     $203C
  379.             dc.w     $000C
  380.             dc.w     $0002
  381.             dc.w     $ABEE
  382.         EndM
  383.     ELSE
  384.         IMPORT    ConcatenateProfiles
  385.     ENDIF
  386.  
  387. ;
  388. ;** Profile manipulation routines
  389. ;
  390.     IF GENERATING68K THEN
  391.         Macro
  392.         _GetProfileName
  393.             dc.w     $203C
  394.             dc.w     $0008
  395.             dc.w     $0004
  396.             dc.w     $ABEE
  397.         EndM
  398.     ELSE
  399.         IMPORT    GetProfileName
  400.     ENDIF
  401.  
  402.     IF GENERATING68K THEN
  403.         Macro
  404.         _GetProfileAdditionalDataOffset
  405.             dc.w     $203C
  406.             dc.w     $0004
  407.             dc.w     $0005
  408.             dc.w     $ABEE
  409.         EndM
  410.     ELSE
  411.         IMPORT    GetProfileAdditionalDataOffset
  412.     ENDIF
  413.  
  414. ;
  415. ;** Low level color calculation routines
  416. ;
  417.     IF GENERATING68K THEN
  418.         Macro
  419.         _CWNewColorWorld
  420.             dc.w     $203C
  421.             dc.w     $000C
  422.             dc.w     $0000
  423.             dc.w     $ABEE
  424.         EndM
  425.     ELSE
  426.         IMPORT    CWNewColorWorld
  427.     ENDIF
  428.  
  429.     IF GENERATING68K THEN
  430.         Macro
  431.         _CWDisposeColorWorld
  432.             dc.w     $203C
  433.             dc.w     $0004
  434.             dc.w     $0000
  435.             dc.w     $ABEE
  436.         EndM
  437.     ELSE
  438.         IMPORT    CWDisposeColorWorld
  439.     ENDIF
  440.  
  441.     IF GENERATING68K THEN
  442.         Macro
  443.         _CWMatchColors
  444.             dc.w     $203C
  445.             dc.w     $000C
  446.             dc.w     $0000
  447.             dc.w     $ABEE
  448.         EndM
  449.     ELSE
  450.         IMPORT    CWMatchColors
  451.     ENDIF
  452.  
  453.     IF GENERATING68K THEN
  454.         Macro
  455.         _CWCheckColors
  456.             dc.w     $203C
  457.             dc.w     $0010
  458.             dc.w     $0000
  459.             dc.w     $ABEE
  460.         EndM
  461.     ELSE
  462.         IMPORT    CWCheckColors
  463.     ENDIF
  464.  
  465.     IF GENERATING68K THEN
  466.         Macro
  467.         _CWMatchPixMap
  468.             dc.w     $203C
  469.             dc.w     $0010
  470.             dc.w     $0000
  471.             dc.w     $ABEE
  472.         EndM
  473.     ELSE
  474.         IMPORT    CWMatchPixMap
  475.     ENDIF
  476.  
  477.     IF GENERATING68K THEN
  478.         Macro
  479.         _CWCheckPixMap
  480.             dc.w     $203C
  481.             dc.w     $0014
  482.             dc.w     $0000
  483.             dc.w     $ABEE
  484.         EndM
  485.     ELSE
  486.         IMPORT    CWCheckPixMap
  487.     ENDIF
  488.  
  489.     ENDIF ; __CMAPPLICATION__
  490.